{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%cd -q ../Terminal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A = A + A__x\u001b[0m*\u001b[0;34me_x\u001b[0m + A__y\u001b[0m*\u001b[0;34me_y\u001b[0m + A__z\u001b[0m*\u001b[0;34me_z\u001b[0m + A__x\u001b[0my\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + A__x\u001b[0mz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + A__y\u001b[0mz\u001b[0m*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m + A__x\u001b[0my\u001b[0mz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "A =  A\n",
      " + A__x\u001b[0m*\u001b[0;34me_x\u001b[0m + A__y\u001b[0m*\u001b[0;34me_y\u001b[0m + A__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      " + A__x\u001b[0my\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + A__x\u001b[0mz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + A__y\u001b[0mz\u001b[0m*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      " + A__x\u001b[0my\u001b[0mz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "A =  A\n",
      " + A__x\u001b[0m*\u001b[0;34me_x\u001b[0m\n",
      " + A__y\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      " + A__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      " + A__x\u001b[0my\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m\n",
      " + A__x\u001b[0mz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      " + A__y\u001b[0mz\u001b[0m*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      " + A__x\u001b[0my\u001b[0mz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[(\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m), (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m), (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_z\u001b[0m)],\n",
      "[(\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m), (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m), (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_z\u001b[0m)],\n",
      "[(\u001b[0;34me_x\u001b[0m.\u001b[0;34me_z\u001b[0m), (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_z\u001b[0m), (\u001b[0;34me_z\u001b[0m.\u001b[0;34me_z\u001b[0m)]])\n",
      "X = X__x\u001b[0m*\u001b[0;34me_x\u001b[0m + X__y\u001b[0m*\u001b[0;34me_y\u001b[0m + X__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "Y = Y__x\u001b[0m*\u001b[0;34me_x\u001b[0m + Y__y\u001b[0m*\u001b[0;34me_y\u001b[0m + Y__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "X*Y =  (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m)*X__x\u001b[0m*Y__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__x\u001b[0m*Y__y\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m*Y__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__x\u001b[0m*Y__z\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__z\u001b[0m*Y__x\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m*Y__y\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__y\u001b[0m*Y__z\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__z\u001b[0m*Y__y\u001b[0m + (\u001b[0;34me_z\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__z\u001b[0m*Y__z\u001b[0m\n",
      " + (X__x\u001b[0m*Y__y\u001b[0m - X__y\u001b[0m*Y__x\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + (X__x\u001b[0m*Y__z\u001b[0m - X__z\u001b[0m*Y__x\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + (X__y\u001b[0m*Y__z\u001b[0m - X__z\u001b[0m*Y__y\u001b[0m)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "X^Y =  (X__x\u001b[0m*Y__y\u001b[0m - X__y\u001b[0m*Y__x\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + (X__x\u001b[0m*Y__z\u001b[0m - X__z\u001b[0m*Y__x\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + (X__y\u001b[0m*Y__z\u001b[0m - X__z\u001b[0m*Y__y\u001b[0m)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "X|Y = (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m)*X__x\u001b[0m*Y__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__x\u001b[0m*Y__y\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m*Y__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__x\u001b[0m*Y__z\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__z\u001b[0m*Y__x\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m*Y__y\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__y\u001b[0m*Y__z\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__z\u001b[0m*Y__y\u001b[0m + (\u001b[0;34me_z\u001b[0m.\u001b[0;34me_z\u001b[0m)*X__z\u001b[0m*Y__z\u001b[0m\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[(\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m), (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)],\n",
      "[(\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m), (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m)]])\n",
      "X = X__x\u001b[0m*\u001b[0;34me_x\u001b[0m + X__y\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "A = A + A__x\u001b[0my\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m\n",
      "X|A =  -A__x\u001b[0my\u001b[0m*((\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__x\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m)*\u001b[0;34me_x\u001b[0m + A__x\u001b[0my\u001b[0m*((\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m)*X__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m)*\u001b[0;34me_y\u001b[0m\n",
      "X<A =  -A__x\u001b[0my\u001b[0m*((\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__x\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m)*\u001b[0;34me_x\u001b[0m + A__x\u001b[0my\u001b[0m*((\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m)*X__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m)*\u001b[0;34me_y\u001b[0m\n",
      "A>X =  A__x\u001b[0my\u001b[0m*((\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__x\u001b[0m + (\u001b[0;34me_y\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m)*\u001b[0;34me_x\u001b[0m - A__x\u001b[0my\u001b[0m*((\u001b[0;34me_x\u001b[0m.\u001b[0;34me_x\u001b[0m)*X__x\u001b[0m + (\u001b[0;34me_x\u001b[0m.\u001b[0;34me_y\u001b[0m)*X__y\u001b[0m)*\u001b[0;34me_y\u001b[0m\n",
      "g_{ii} =\n",
      " Matrix([\n",
      "[1, 0],\n",
      "[0, 1]])\n",
      "X = X__x\u001b[0m*\u001b[0;34me_x\u001b[0m + X__y\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "A = A + A__x\u001b[0my\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m\n",
      "X*A =  (A*X__x\u001b[0m - A__x\u001b[0my\u001b[0m*X__y\u001b[0m)*\u001b[0;34me_x\u001b[0m + (A*X__y\u001b[0m + A__x\u001b[0my\u001b[0m*X__x\u001b[0m)*\u001b[0;34me_y\u001b[0m\n",
      "X|A =  -A__x\u001b[0my\u001b[0m*X__y\u001b[0m*\u001b[0;34me_x\u001b[0m + A__x\u001b[0my\u001b[0m*X__x\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "X<A =  -A__x\u001b[0my\u001b[0m*X__y\u001b[0m*\u001b[0;34me_x\u001b[0m + A__x\u001b[0my\u001b[0m*X__x\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "X>A =  A*X__x\u001b[0m*\u001b[0;34me_x\u001b[0m + A*X__y\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "A*X =  (A*X__x\u001b[0m + A__x\u001b[0my\u001b[0m*X__y\u001b[0m)*\u001b[0;34me_x\u001b[0m + (A*X__y\u001b[0m - A__x\u001b[0my\u001b[0m*X__x\u001b[0m)*\u001b[0;34me_y\u001b[0m\n",
      "A|X =  A__x\u001b[0my\u001b[0m*X__y\u001b[0m*\u001b[0;34me_x\u001b[0m - A__x\u001b[0my\u001b[0m*X__x\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "A<X =  A*X__x\u001b[0m*\u001b[0;34me_x\u001b[0m + A*X__y\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "A>X =  A__x\u001b[0my\u001b[0m*X__y\u001b[0m*\u001b[0;34me_x\u001b[0m - A__x\u001b[0my\u001b[0m*X__x\u001b[0m*\u001b[0;34me_y\u001b[0m\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[(\u001b[0;34ma\u001b[0m.\u001b[0;34ma\u001b[0m), (\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m), (\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m), (\u001b[0;34ma\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34ma\u001b[0m.\u001b[0;34me\u001b[0m)],\n",
      "[(\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34mb\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34mc\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34me\u001b[0m)],\n",
      "[(\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34mc\u001b[0m), (\u001b[0;34mc\u001b[0m.\u001b[0;34mc\u001b[0m), (\u001b[0;34mc\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34mc\u001b[0m.\u001b[0;34me\u001b[0m)],\n",
      "[(\u001b[0;34ma\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34mc\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34md\u001b[0m.\u001b[0;34md\u001b[0m), (\u001b[0;34md\u001b[0m.\u001b[0;34me\u001b[0m)],\n",
      "[(\u001b[0;34ma\u001b[0m.\u001b[0;34me\u001b[0m), (\u001b[0;34mb\u001b[0m.\u001b[0;34me\u001b[0m), (\u001b[0;34mc\u001b[0m.\u001b[0;34me\u001b[0m), (\u001b[0;34md\u001b[0m.\u001b[0;34me\u001b[0m), (\u001b[0;34me\u001b[0m.\u001b[0;34me\u001b[0m)]])\n",
      "a|(b*c) = -(\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*\u001b[0;34mb\u001b[0m + (\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m)*\u001b[0;34mc\u001b[0m\n",
      "a|(b^c) = -(\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*\u001b[0;34mb\u001b[0m + (\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m)*\u001b[0;34mc\u001b[0m\n",
      "a|(b^c^d) = (\u001b[0;34ma\u001b[0m.\u001b[0;34md\u001b[0m)*\u001b[0;34mb\u001b[0m^\u001b[0;34mc\u001b[0m - (\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*\u001b[0;34mb\u001b[0m^\u001b[0;34md\u001b[0m + (\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m)*\u001b[0;34mc\u001b[0m^\u001b[0;34md\u001b[0m\n",
      "a|(b^c)+c|(a^b)+b|(c^a) = 0\n",
      "a*(b^c)-b*(a^c)+c*(a^b) = 3*\u001b[0;34ma\u001b[0m^\u001b[0;34mb\u001b[0m^\u001b[0;34mc\u001b[0m\n",
      "a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c) = 4*\u001b[0;34ma\u001b[0m^\u001b[0;34mb\u001b[0m^\u001b[0;34mc\u001b[0m^\u001b[0;34md\u001b[0m\n",
      "(a^b)|(c^d) = -(\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*(\u001b[0;34mb\u001b[0m.\u001b[0;34md\u001b[0m) + (\u001b[0;34ma\u001b[0m.\u001b[0;34md\u001b[0m)*(\u001b[0;34mb\u001b[0m.\u001b[0;34mc\u001b[0m)\n",
      "((a^b)|c)|d = -(\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*(\u001b[0;34mb\u001b[0m.\u001b[0;34md\u001b[0m) + (\u001b[0;34ma\u001b[0m.\u001b[0;34md\u001b[0m)*(\u001b[0;34mb\u001b[0m.\u001b[0;34mc\u001b[0m)\n",
      "(a^b)x(c^d) = -(\u001b[0;34mb\u001b[0m.\u001b[0;34md\u001b[0m)*\u001b[0;34ma\u001b[0m^\u001b[0;34mc\u001b[0m + (\u001b[0;34mb\u001b[0m.\u001b[0;34mc\u001b[0m)*\u001b[0;34ma\u001b[0m^\u001b[0;34md\u001b[0m + (\u001b[0;34ma\u001b[0m.\u001b[0;34md\u001b[0m)*\u001b[0;34mb\u001b[0m^\u001b[0;34mc\u001b[0m - (\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*\u001b[0;34mb\u001b[0m^\u001b[0;34md\u001b[0m\n",
      "(a|(b^c))|(d^e) = (-(\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m)*(\u001b[0;34mc\u001b[0m.\u001b[0;34me\u001b[0m) + (\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*(\u001b[0;34mb\u001b[0m.\u001b[0;34me\u001b[0m))*\u001b[0;34md\u001b[0m + ((\u001b[0;34ma\u001b[0m.\u001b[0;34mb\u001b[0m)*(\u001b[0;34mc\u001b[0m.\u001b[0;34md\u001b[0m) - (\u001b[0;34ma\u001b[0m.\u001b[0;34mc\u001b[0m)*(\u001b[0;34mb\u001b[0m.\u001b[0;34md\u001b[0m))*\u001b[0;34me\u001b[0m\n",
      "f = \u001b[0;31mf\u001b[0m\n",
      "A = \u001b[0;31mA__x\u001b[0m*\u001b[0;34me_x\u001b[0m + \u001b[0;31mA__y\u001b[0m*\u001b[0;34me_y\u001b[0m + \u001b[0;31mA__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "B = \u001b[0;31mB__xy\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + \u001b[0;31mB__xz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + \u001b[0;31mB__yz\u001b[0m*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "C = \u001b[0;31mC\u001b[0m + \u001b[0;31mC__x\u001b[0m*\u001b[0;34me_x\u001b[0m + \u001b[0;31mC__y\u001b[0m*\u001b[0;34me_y\u001b[0m + \u001b[0;31mC__z\u001b[0m*\u001b[0;34me_z\u001b[0m + \u001b[0;31mC__xy\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + \u001b[0;31mC__xz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + \u001b[0;31mC__yz\u001b[0m*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m + \u001b[0;31mC__xyz\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "grad*f = \u001b[0;36mD{x}\u001b[0;31mf\u001b[0m\u001b[0m*\u001b[0;34me_x\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mf\u001b[0m\u001b[0m*\u001b[0;34me_y\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mf\u001b[0m\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "grad|A = \u001b[0;36mD{x}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mA__y\u001b[0m\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mA__z\u001b[0m\u001b[0m\n",
      "grad*A = \u001b[0;36mD{x}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mA__y\u001b[0m\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mA__z\u001b[0m\u001b[0m + (-\u001b[0;36mD{y}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mA__y\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + (-\u001b[0;36mD{z}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mA__z\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + (-\u001b[0;36mD{z}\u001b[0;31mA__y\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mA__z\u001b[0m\u001b[0m)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "-I*(grad^A) = (-\u001b[0;36mD{z}\u001b[0;31mA__y\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mA__z\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m + (\u001b[0;36mD{z}\u001b[0;31mA__x\u001b[0m\u001b[0m - \u001b[0;36mD{x}\u001b[0;31mA__z\u001b[0m\u001b[0m)*\u001b[0;34me_y\u001b[0m + (-\u001b[0;36mD{y}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mA__y\u001b[0m\u001b[0m)*\u001b[0;34me_z\u001b[0m\n",
      "grad*B = (-\u001b[0;36mD{y}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mB__xz\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_y\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mB__xz\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_z\u001b[0m + (\u001b[0;36mD{z}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{y}\u001b[0;31mB__xz\u001b[0m\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "grad^B = (\u001b[0;36mD{z}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{y}\u001b[0;31mB__xz\u001b[0m\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "grad|B = (-\u001b[0;36mD{y}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mB__xz\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_y\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mB__xz\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_z\u001b[0m\n",
      "grad<A = \u001b[0;36mD{x}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mA__y\u001b[0m\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mA__z\u001b[0m\u001b[0m\n",
      "grad>A = \u001b[0;36mD{x}\u001b[0;31mA__x\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mA__y\u001b[0m\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mA__z\u001b[0m\u001b[0m\n",
      "grad<B = (-\u001b[0;36mD{y}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mB__xz\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mB__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_y\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mB__xz\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mB__yz\u001b[0m\u001b[0m)*\u001b[0;34me_z\u001b[0m\n",
      "grad>B = 0\n",
      "grad<C = \u001b[0;36mD{x}\u001b[0;31mC__x\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mC__y\u001b[0m\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mC__z\u001b[0m\u001b[0m + (-\u001b[0;36mD{y}\u001b[0;31mC__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mC__xz\u001b[0m\u001b[0m)*\u001b[0;34me_x\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mC__xy\u001b[0m\u001b[0m - \u001b[0;36mD{z}\u001b[0;31mC__yz\u001b[0m\u001b[0m)*\u001b[0;34me_y\u001b[0m + (\u001b[0;36mD{x}\u001b[0;31mC__xz\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mC__yz\u001b[0m\u001b[0m)*\u001b[0;34me_z\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mC__xyz\u001b[0m\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m - \u001b[0;36mD{y}\u001b[0;31mC__xyz\u001b[0m\u001b[0m*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mC__xyz\u001b[0m\u001b[0m*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "grad>C = \u001b[0;36mD{x}\u001b[0;31mC__x\u001b[0m\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mC__y\u001b[0m\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mC__z\u001b[0m\u001b[0m + \u001b[0;36mD{x}\u001b[0;31mC\u001b[0m\u001b[0m*\u001b[0;34me_x\u001b[0m + \u001b[0;36mD{y}\u001b[0;31mC\u001b[0m\u001b[0m*\u001b[0;34me_y\u001b[0m + \u001b[0;36mD{z}\u001b[0;31mC\u001b[0m\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "f = \u001b[0;31mf\u001b[0m\n",
      "A = \u001b[0;31mA__r\u001b[0m*\u001b[0;34me_r\u001b[0m + \u001b[0;31mA__theta\u001b[0m*\u001b[0;34me_theta\u001b[0m + \u001b[0;31mA__phi\u001b[0m*\u001b[0;34me_phi\u001b[0m\n",
      "B = \u001b[0;31mB__rtheta\u001b[0m*\u001b[0;34me_r\u001b[0m^\u001b[0;34me_theta\u001b[0m + \u001b[0;31mB__rphi\u001b[0m*\u001b[0;34me_r\u001b[0m^\u001b[0;34me_phi\u001b[0m + \u001b[0;31mB__thetaphi\u001b[0m*\u001b[0;34me_theta\u001b[0m^\u001b[0;34me_phi\u001b[0m\n",
      "grad*f = \u001b[0;36mD{r}\u001b[0;31mf\u001b[0m\u001b[0m*\u001b[0;34me_r\u001b[0m + \u001b[0;36mD{theta}\u001b[0;31mf\u001b[0m\u001b[0m*\u001b[0;34me_theta\u001b[0m/r + \u001b[0;36mD{phi}\u001b[0;31mf\u001b[0m\u001b[0m*\u001b[0;34me_phi\u001b[0m/(r*sin(theta))\n",
      "grad|A = (r*\u001b[0;36mD{r}\u001b[0;31mA__r\u001b[0m\u001b[0m + 2*\u001b[0;31mA__r\u001b[0m + \u001b[0;31mA__theta\u001b[0m/tan(theta) + \u001b[0;36mD{theta}\u001b[0;31mA__theta\u001b[0m\u001b[0m + \u001b[0;36mD{phi}\u001b[0;31mA__phi\u001b[0m\u001b[0m/sin(theta))/r\n",
      "-I*(grad^A) = (\u001b[0;31mA__phi\u001b[0m/tan(theta) + \u001b[0;36mD{theta}\u001b[0;31mA__phi\u001b[0m\u001b[0m - \u001b[0;36mD{phi}\u001b[0;31mA__theta\u001b[0m\u001b[0m/sin(theta))*\u001b[0;34me_r\u001b[0m/r + (-r*\u001b[0;36mD{r}\u001b[0;31mA__phi\u001b[0m\u001b[0m - \u001b[0;31mA__phi\u001b[0m + \u001b[0;36mD{phi}\u001b[0;31mA__r\u001b[0m\u001b[0m/sin(theta))*\u001b[0;34me_theta\u001b[0m/r + (r*\u001b[0;36mD{r}\u001b[0;31mA__theta\u001b[0m\u001b[0m + \u001b[0;31mA__theta\u001b[0m - \u001b[0;36mD{theta}\u001b[0;31mA__r\u001b[0m\u001b[0m)*\u001b[0;34me_phi\u001b[0m/r\n",
      "grad^B = (r*\u001b[0;36mD{r}\u001b[0;31mB__thetaphi\u001b[0m\u001b[0m - \u001b[0;31mB__rphi\u001b[0m/tan(theta) + 2*\u001b[0;31mB__thetaphi\u001b[0m - \u001b[0;36mD{theta}\u001b[0;31mB__rphi\u001b[0m\u001b[0m + \u001b[0;36mD{phi}\u001b[0;31mB__rtheta\u001b[0m\u001b[0m/sin(theta))*\u001b[0;34me_r\u001b[0m^\u001b[0;34me_theta\u001b[0m^\u001b[0;34me_phi\u001b[0m/r\n",
      "X = 1.2*\u001b[0;34me_x\u001b[0m + 2.34*\u001b[0;34me_y\u001b[0m + 0.555*\u001b[0;34me_z\u001b[0m\n",
      "Nga(X,2) = 1.2*\u001b[0;34me_x\u001b[0m + 2.3*\u001b[0;34me_y\u001b[0m + 0.55*\u001b[0;34me_z\u001b[0m\n",
      "X*Y = 12.7011 + 4.02078*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + 6.175185*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + 10.182*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "Nga(X*Y,2) = 13.0 + 4.0*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + 6.2*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + 10.0*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "g_{ij} = Matrix([\n",
      "[                          0, (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m), (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)],\n",
      "[(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m),                           0, (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)],\n",
      "[(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m), (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m),                           1]])\n",
      "(X^Y)**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2\n",
      "B = \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n",
      "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n",
      "#L = X^Y^e is a non-euclidian line\n",
      "B = L*e = \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n",
      "B*e*B.rev() = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(-(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))*\u001b[0;34me\u001b[0m\n",
      "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n",
      "L**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n",
      "s = sinh(alpha/2) and c = cosh(alpha/2)\n",
      "exp(alpha*B/(2*|B|)) = c + (1/B)*s*\u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*s*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*s*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n",
      "R*X*R.rev() =  ((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2*(1/B)**2*s**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)**2*s**2 + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(1/B)*c*s - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*c*s + c**2)*\u001b[0;34mX\u001b[0m\n",
      " + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)**2*(1/B)*c*s*\u001b[0;34mY\u001b[0m\n",
      " + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*s*(-(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(1/B)*s + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*s - c)*\u001b[0;34me\u001b[0m\n",
      "Objective is to determine value of C = cosh(alpha) such that W = 0\n",
      "Z|Y = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**3*(1/B)**2*s**2 - 4*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)**2*s**2 + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2*(1/B)*c*s + 4*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)**2*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)**2*(1/B)**2*s**2 - 4*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*c*s + (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*c**2\n",
      "S = sinh(alpha) and C = cosh(alpha)\n",
      "W = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*C - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*C + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + S*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n",
      "Scalar Coefficient = (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n",
      "Cosh Coefficient = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n",
      "Sinh Coefficient = sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n",
      "|B| = sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n",
      "Require a*C**2+b*C+c = 0\n",
      "a = (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)**2*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)**2\n",
      "b = 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n",
      "c = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)**2*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)**2\n",
      "cosh(alpha) = C = -b/(2*a) = -(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)/((\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)) + 1\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[1, 0, 0, 0, 0],\n",
      "[0, 1, 0, 0, 0],\n",
      "[0, 0, 1, 0, 0],\n",
      "[0, 0, 0, 0, 2],\n",
      "[0, 0, 0, 2, 0]])\n",
      "F(a) = \u001b[0;34me_1\u001b[0m + \u001b[0;34mn\u001b[0m/2 - \u001b[0;34mnbar\u001b[0m/2\n",
      "F(b) = \u001b[0;34me_2\u001b[0m + \u001b[0;34mn\u001b[0m/2 - \u001b[0;34mnbar\u001b[0m/2\n",
      "F(c) = -\u001b[0;34me_1\u001b[0m + \u001b[0;34mn\u001b[0m/2 - \u001b[0;34mnbar\u001b[0m/2\n",
      "F(d) = \u001b[0;34me_3\u001b[0m + \u001b[0;34mn\u001b[0m/2 - \u001b[0;34mnbar\u001b[0m/2\n",
      "F(x) = x1*\u001b[0;34me_1\u001b[0m + x2*\u001b[0;34me_2\u001b[0m + x3*\u001b[0;34me_3\u001b[0m + (x1**2/2 + x2**2/2 + x3**2/2)*\u001b[0;34mn\u001b[0m - \u001b[0;34mnbar\u001b[0m/2\n",
      "a = e1, b = e2, c = -e1, and d = e3\n",
      "A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.\n",
      "Circle through a, b, and c\n",
      "Circle: A^B^C^X = 0 = -x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m + x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mnbar\u001b[0m + (x1**2/2 + x2**2/2 + x3**2/2 - 1/2)*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      "Line through a and b\n",
      "Line  : A^B^n^X = 0 = -x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m + (x1/2 + x2/2 - 1/2)*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m + x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m/2 - x3*\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m/2\n",
      "Sphere through a, b, c, and d\n",
      "Sphere: A^B^C^D^X = 0 = (-x1**2/2 - x2**2/2 - x3**2/2 + 1/2)*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      "Plane through a, b, and d\n",
      "Plane : A^B^n^D^X = 0 = (-x1/2 - x2/2 - x3/2 + 1/2)*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      "Hyperbolic Circle: (A^B^e)^X = 0 = =  -x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m\n",
      " - x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      " + (-x1**2/2 + x1 - x2**2/2 + x2 - x3**2/2 - 1/2)*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      " + x3*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      " - x3*\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34mnbar\u001b[0m\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[(\u001b[0;34mp1\u001b[0m.\u001b[0;34mp1\u001b[0m), (\u001b[0;34mp1\u001b[0m.\u001b[0;34mp2\u001b[0m), (\u001b[0;34mp1\u001b[0m.\u001b[0;34mp3\u001b[0m), 0, 0],\n",
      "[(\u001b[0;34mp1\u001b[0m.\u001b[0;34mp2\u001b[0m), (\u001b[0;34mp2\u001b[0m.\u001b[0;34mp2\u001b[0m), (\u001b[0;34mp2\u001b[0m.\u001b[0;34mp3\u001b[0m), 0, 0],\n",
      "[(\u001b[0;34mp1\u001b[0m.\u001b[0;34mp3\u001b[0m), (\u001b[0;34mp2\u001b[0m.\u001b[0;34mp3\u001b[0m), (\u001b[0;34mp3\u001b[0m.\u001b[0;34mp3\u001b[0m), 0, 0],\n",
      "[                            0,                             0,                             0, 0, 2],\n",
      "[                            0,                             0,                             0, 2, 0]])\n",
      "Extracting direction of line from L = P1^P2^n\n",
      "(L|n)|nbar = 2*\u001b[0;34mp1\u001b[0m - 2*\u001b[0;34mp2\u001b[0m\n",
      "Extracting plane of circle from C = P1^P2^P3\n",
      "((C^n)|n)|nbar = 2*\u001b[0;34mp1\u001b[0m^\u001b[0;34mp2\u001b[0m - 2*\u001b[0;34mp1\u001b[0m^\u001b[0;34mp3\u001b[0m + 2*\u001b[0;34mp2\u001b[0m^\u001b[0;34mp3\u001b[0m\n",
      "(p2-p1)^(p3-p1) = \u001b[0;34mp1\u001b[0m^\u001b[0;34mp2\u001b[0m - \u001b[0;34mp1\u001b[0m^\u001b[0;34mp3\u001b[0m + \u001b[0;34mp2\u001b[0m^\u001b[0;34mp3\u001b[0m\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[                           0,                           -1, (\u001b[0;34mP1\u001b[0m.\u001b[0;34ma\u001b[0m)],\n",
      "[                          -1,                            0, (\u001b[0;34mP2\u001b[0m.\u001b[0;34ma\u001b[0m)],\n",
      "[(\u001b[0;34mP1\u001b[0m.\u001b[0;34ma\u001b[0m), (\u001b[0;34mP2\u001b[0m.\u001b[0;34ma\u001b[0m),  (\u001b[0;34ma\u001b[0m.\u001b[0;34ma\u001b[0m)]])\n",
      "B**2 = 1\n",
      "a' = a-(a^B)*B = -(\u001b[0;34mP2\u001b[0m.\u001b[0;34ma\u001b[0m)*\u001b[0;34mP1\u001b[0m - (\u001b[0;34mP1\u001b[0m.\u001b[0;34ma\u001b[0m)*\u001b[0;34mP2\u001b[0m\n",
      "A+ = a'+a'*B = -2*(\u001b[0;34mP2\u001b[0m.\u001b[0;34ma\u001b[0m)*\u001b[0;34mP1\u001b[0m\n",
      "A- = a'-a'*B = -2*(\u001b[0;34mP1\u001b[0m.\u001b[0;34ma\u001b[0m)*\u001b[0;34mP2\u001b[0m\n",
      "(A+)^2 = 0\n",
      "(A-)^2 = 0\n",
      "a|B = -(\u001b[0;34mP2\u001b[0m.\u001b[0;34ma\u001b[0m)*\u001b[0;34mP1\u001b[0m + (\u001b[0;34mP1\u001b[0m.\u001b[0;34ma\u001b[0m)*\u001b[0;34mP2\u001b[0m\n",
      "g_{ij} =\n",
      " Matrix([\n",
      "[                            1, (\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m), (\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m)],\n",
      "[(\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m),                             1, (\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m)],\n",
      "[(\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m), (\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m),                             1]])\n",
      "E = \u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m\n",
      "E**2 = (\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)**2 - 2*(\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)*(\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m)*(\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m) + (\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m)**2 + (\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m)**2 - 1\n",
      "E1 = (e2^e3)*E = ((\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m)**2 - 1)*\u001b[0;34me1\u001b[0m + ((\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m) - (\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m)*(\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m))*\u001b[0;34me2\u001b[0m + (-(\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)*(\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m) + (\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m))*\u001b[0;34me3\u001b[0m\n",
      "E2 =-(e1^e3)*E = ((\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m) - (\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m)*(\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m))*\u001b[0;34me1\u001b[0m + ((\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m)**2 - 1)*\u001b[0;34me2\u001b[0m + (-(\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)*(\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m) + (\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m))*\u001b[0;34me3\u001b[0m\n",
      "E3 = (e1^e2)*E = (-(\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)*(\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m) + (\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m))*\u001b[0;34me1\u001b[0m + (-(\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)*(\u001b[0;34me1\u001b[0m.\u001b[0;34me3\u001b[0m) + (\u001b[0;34me2\u001b[0m.\u001b[0;34me3\u001b[0m))*\u001b[0;34me2\u001b[0m + ((\u001b[0;34me1\u001b[0m.\u001b[0;34me2\u001b[0m)**2 - 1)*\u001b[0;34me3\u001b[0m\n",
      "E1|e2 = 0\n",
      "E1|e3 = 0\n",
      "E2|e1 = 0\n",
      "E2|e3 = 0\n",
      "E3|e1 = 0\n",
      "E3|e2 = 0\n",
      "(E1|e1)/E**2 = 1\n",
      "(E2|e2)/E**2 = 1\n",
      "(E3|e3)/E**2 = 1\n",
      "e3d.g = Matrix([\n",
      "[1, 0, 0],\n",
      "[0, 1, 0],\n",
      "[0, 0, 1]])\n",
      "Signature = (3,0) I = \u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m  I**2 = -1\n",
      "e3d.g = Matrix([\n",
      "[2, 0, 0],\n",
      "[0, 2, 0],\n",
      "[0, 0, 2]])\n",
      "Signature = (3,0) I = sqrt(2)*\u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m/4  I**2 = -1\n",
      "e3d.g = Matrix([\n",
      "[1,  0,  0,  0],\n",
      "[0, -1,  0,  0],\n",
      "[0,  0, -1,  0],\n",
      "[0,  0,  0, -1]])\n",
      "Signature = (1,3) I = \u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m^\u001b[0;34me4\u001b[0m  I**2 = -1\n",
      "e3d.g = Matrix([\n",
      "[2,  0,  0,  0],\n",
      "[0, -2,  0,  0],\n",
      "[0,  0, -2,  0],\n",
      "[0,  0,  0, -2]])\n",
      "Signature = (1,3) I = \u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m^\u001b[0;34me4\u001b[0m/4  I**2 = -1\n",
      "e4d.g = Matrix([\n",
      "[1, 0, 0, 0],\n",
      "[0, 1, 0, 0],\n",
      "[0, 0, 1, 0],\n",
      "[0, 0, 0, 1]])\n",
      "Signature = (4,0) I = \u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m^\u001b[0;34me4\u001b[0m  I**2 = 1\n",
      "cf4d.g = Matrix([\n",
      "[1, 0, 0, 0,  0],\n",
      "[0, 1, 0, 0,  0],\n",
      "[0, 0, 1, 0,  0],\n",
      "[0, 0, 0, 1,  0],\n",
      "[0, 0, 0, 0, -1]])\n",
      "Signature = (4,1) I = \u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m^\u001b[0;34me4\u001b[0m^\u001b[0;34me5\u001b[0m  I**2 = -1\n",
      "cf4d.g = Matrix([\n",
      "[2, 0, 0, 0,  0],\n",
      "[0, 2, 0, 0,  0],\n",
      "[0, 0, 2, 0,  0],\n",
      "[0, 0, 0, 2,  0],\n",
      "[0, 0, 0, 0, -2]])\n",
      "Signature = (4,1) I = sqrt(2)*\u001b[0;34me1\u001b[0m^\u001b[0;34me2\u001b[0m^\u001b[0;34me3\u001b[0m^\u001b[0;34me4\u001b[0m^\u001b[0;34me5\u001b[0m/8  I**2 = -1\n"
     ]
    }
   ],
   "source": [
    "%run terminal_check.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "s**2\n",
      "\u001b[0;31mf\u001b[0m\n",
      "\u001b[0;36mD{s}\u001b[0;31mf\u001b[0m\u001b[0m\n",
      "\\frac{d}{d s} f{\\left(s^{2} \\right)}\n"
     ]
    }
   ],
   "source": [
    "%run 1d_grad.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "********************************************************************************\n",
      "def coefs_test():\n",
      "    Print_Function()\n",
      "\n",
      "    (o3d,e1,e2,e3) = Ga.build('e_1 e_2 e_3',g=[1,1,1])\n",
      "    print(o3d.blades.flat)\n",
      "    print(o3d.mv_blades.flat)\n",
      "    v = o3d.mv('v', 'vector')\n",
      "    print(v)\n",
      "    print(v.blade_coefs([e3,e1]))\n",
      "    A = o3d.mv('A', 'mv')\n",
      "    print(A)\n",
      "    print(A.blade_coefs([e1^e3,e3,e1^e2,e1^e2^e3]))\n",
      "    print(A.blade_coefs())\n",
      "    return\n",
      "\n",
      "Code output:\n",
      "\n",
      "(1, \u001b[0;34me_1\u001b[0m, \u001b[0;34me_2\u001b[0m, \u001b[0;34me_3\u001b[0m, \u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m, \u001b[0;34me_1\u001b[0m^\u001b[0;34me_3\u001b[0m, \u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m, \u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m)\n",
      "(1, \u001b[0;34me_1\u001b[0m, \u001b[0;34me_2\u001b[0m, \u001b[0;34me_3\u001b[0m, \u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m, \u001b[0;34me_1\u001b[0m^\u001b[0;34me_3\u001b[0m, \u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m, \u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m)\n",
      "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\n",
      "[v__3\u001b[0m, v__1\u001b[0m]\n",
      "A + A__1\u001b[0m*\u001b[0;34me_1\u001b[0m + A__2\u001b[0m*\u001b[0;34me_2\u001b[0m + A__3\u001b[0m*\u001b[0;34me_3\u001b[0m + A__1\u001b[0m2\u001b[0m*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m + A__1\u001b[0m3\u001b[0m*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_3\u001b[0m + A__2\u001b[0m3\u001b[0m*\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m + A__1\u001b[0m2\u001b[0m3\u001b[0m*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34me_3\u001b[0m\n",
      "[A__1\u001b[0m3\u001b[0m, A__3\u001b[0m, A__1\u001b[0m2\u001b[0m, A__1\u001b[0m2\u001b[0m3\u001b[0m]\n",
      "[A, A__1\u001b[0m, A__2\u001b[0m, A__3\u001b[0m, A__1\u001b[0m2\u001b[0m, A__1\u001b[0m3\u001b[0m, A__2\u001b[0m3\u001b[0m, A__1\u001b[0m2\u001b[0m3\u001b[0m]\n"
     ]
    }
   ],
   "source": [
    "%run coefs_test.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A = \u001b[0;34me_1\u001b[0m/2 + \u001b[0;34mn\u001b[0m/8 - \u001b[0;34m\\bar{n}\u001b[0m/2\n",
      "B = 2*\u001b[0;34me_1\u001b[0m + 2*\u001b[0;34mn\u001b[0m - \u001b[0;34m\\bar{n}\u001b[0m/2\n",
      "C = 4*\u001b[0;34me_1\u001b[0m/5 + 3*\u001b[0;34me_2\u001b[0m/5 + \u001b[0;34mn\u001b[0m/2 - \u001b[0;34m\\bar{n}\u001b[0m/2\n",
      "D = 4*\u001b[0;34me_1\u001b[0m/5 - 3*\u001b[0;34me_2\u001b[0m/5 + \u001b[0;34mn\u001b[0m/2 - \u001b[0;34m\\bar{n}\u001b[0m/2\n",
      "T = -9*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m/20 - 9*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34m\\bar{n}\u001b[0m/20 + 9*\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m^\u001b[0;34m\\bar{n}\u001b[0m/16\n",
      "U = \u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m - \u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m^\u001b[0;34m\\bar{n}\u001b[0m\n",
      "inter = -9*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m/5 + 9*\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m/8 - 9*\u001b[0;34me_2\u001b[0m^\u001b[0;34m\\bar{n}\u001b[0m/8\n",
      "B = -9*\u001b[0;34me_1\u001b[0m^\u001b[0;34me_2\u001b[0m/5 + 9*\u001b[0;34me_2\u001b[0m^\u001b[0;34mn\u001b[0m/8 - 9*\u001b[0;34me_2\u001b[0m^\u001b[0;34m\\bar{n}\u001b[0m/8\n",
      "B**2 = 729/400\n",
      "NB = 27/20\n",
      "20*\u001b[0;34me_1\u001b[0m/9 + 5*\u001b[0;34me_2\u001b[0m/3\n",
      "20*\u001b[0;34me_1\u001b[0m/9 - 5*\u001b[0;34me_2\u001b[0m/3\n",
      "One intersection point x =  20*\u001b[0;34me_1\u001b[0m/9 + 5*\u001b[0;34me_2\u001b[0m/3 + 25*\u001b[0;34mn\u001b[0m/18 - 25*\u001b[0;34m\\bar{n}\u001b[0m/18\n",
      "The other intersection point y =  20*\u001b[0;34me_1\u001b[0m/9 - 5*\u001b[0;34me_2\u001b[0m/3 + 25*\u001b[0;34mn\u001b[0m/18 - 25*\u001b[0;34m\\bar{n}\u001b[0m/18\n",
      "x**2 =  0\n",
      "y**2 =  0\n",
      "T^x =  0\n",
      "T^y =  0\n",
      "U^x =  0\n",
      "U^y =  0\n"
     ]
    }
   ],
   "source": [
    "%run ConformalConsole.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "u__x\u001b[0m*\u001b[0;34me_x\u001b[0m + u__y\u001b[0m*\u001b[0;34me_y\u001b[0m + u__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "v__x\u001b[0m*\u001b[0;34me_x\u001b[0m + v__y\u001b[0m*\u001b[0;34me_y\u001b[0m + v__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "(u__x\u001b[0m*v__y\u001b[0m - u__y\u001b[0m*v__x\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m + (u__x\u001b[0m*v__z\u001b[0m - u__z\u001b[0m*v__x\u001b[0m)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + (u__y\u001b[0m*v__z\u001b[0m - u__z\u001b[0m*v__y\u001b[0m)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "True\n",
      "exp(uv) = cos(sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2)) + (u__x\u001b[0m*v__y\u001b[0m - u__y\u001b[0m*v__x\u001b[0m)*sin(sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2))*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m/sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2) + (u__x\u001b[0m*v__z\u001b[0m - u__z\u001b[0m*v__x\u001b[0m)*sin(sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2))*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m/sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2) + (u__y\u001b[0m*v__z\u001b[0m - u__z\u001b[0m*v__y\u001b[0m)*sin(sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2))*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m/sqrt(u__x\u001b[0m**2*v__y\u001b[0m**2 + u__x\u001b[0m**2*v__z\u001b[0m**2 - 2*u__x\u001b[0m*u__y\u001b[0m*v__x\u001b[0m*v__y\u001b[0m - 2*u__x\u001b[0m*u__z\u001b[0m*v__x\u001b[0m*v__z\u001b[0m + u__y\u001b[0m**2*v__x\u001b[0m**2 + u__y\u001b[0m**2*v__z\u001b[0m**2 - 2*u__y\u001b[0m*u__z\u001b[0m*v__y\u001b[0m*v__z\u001b[0m + u__z\u001b[0m**2*v__x\u001b[0m**2 + u__z\u001b[0m**2*v__y\u001b[0m**2)\n"
     ]
    }
   ],
   "source": [
    "%run exp_check.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Lt(\u001b[0;34me0\u001b[0m) = \u001b[0;34me0\u001b[0m + 2*\u001b[0;34me1\u001b[0m\n",
      "Lt(\u001b[0;34me1\u001b[0m) = 3*\u001b[0;34me0\u001b[0m + 4*\u001b[0;34me1\u001b[0m\n",
      "Lt(\u001b[0;34me0\u001b[0m) = \u001b[0;34me0\u001b[0m + 2*\u001b[0;34me1\u001b[0m\n",
      "Lt(\u001b[0;34me1\u001b[0m) = 3*\u001b[0;34me0\u001b[0m + 4*\u001b[0;34me1\u001b[0m\n",
      "Matrix([\n",
      "[1, 2],\n",
      "[3, 4]])\n"
     ]
    }
   ],
   "source": [
    "%run lt_check.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Lt(\u001b[0;34me0\u001b[0m) = \u001b[0;34me0\u001b[0m + 2*\u001b[0;34me1\u001b[0m + 3*\u001b[0;34me2\u001b[0m\n",
      "Lt(\u001b[0;34me1\u001b[0m) = 4*\u001b[0;34me0\u001b[0m + 5*\u001b[0;34me1\u001b[0m + 6*\u001b[0;34me2\u001b[0m\n",
      "Lt(\u001b[0;34me2\u001b[0m) = 7*\u001b[0;34me0\u001b[0m + 8*\u001b[0;34me1\u001b[0m + 9*\u001b[0;34me2\u001b[0m\n",
      "A.lt_dict[e0]= \u001b[0;34me0\u001b[0m + 2*\u001b[0;34me1\u001b[0m + 3*\u001b[0;34me2\u001b[0m\n",
      "A.lt_dict[e1]= 4*\u001b[0;34me0\u001b[0m + 5*\u001b[0;34me1\u001b[0m + 6*\u001b[0;34me2\u001b[0m\n",
      "A.lt_dict[e2]= 7*\u001b[0;34me0\u001b[0m + 8*\u001b[0;34me1\u001b[0m + 9*\u001b[0;34me2\u001b[0m\n",
      "Matrix([\n",
      "[1, 4, 7],\n",
      "[2, 5, 8],\n",
      "[3, 6, 9]])\n",
      "v__x*\u001b[0;34me0\u001b[0m + v__y*\u001b[0;34me1\u001b[0m + v__z*\u001b[0;34me2\u001b[0m\n",
      "(v__x + 4*v__y + 7*v__z)*\u001b[0;34me0\u001b[0m + (2*v__x + 5*v__y + 8*v__z)*\u001b[0;34me1\u001b[0m + (3*v__x + 6*v__y + 9*v__z)*\u001b[0;34me2\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "%run lt_test.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "********************************************************************************\n",
      "def Mv_setup_options():\n",
      "    Print_Function()\n",
      "\n",
      "    (o3d,e1,e2,e3) = Ga.build('e_1 e_2 e_3',g=[1,1,1])\n",
      "    v = o3d.mv('v', 'vector')\n",
      "    print(v)\n",
      "\n",
      "    (o3d,e1,e2,e3) = Ga.build('e*1|2|3',g=[1,1,1])\n",
      "    v = o3d.mv('v', 'vector')\n",
      "    print(v)\n",
      "\n",
      "    (o3d,e1,e2,e3) = Ga.build('e*x|y|z',g=[1,1,1])\n",
      "    v = o3d.mv('v', 'vector')\n",
      "    print(v)\n",
      "\n",
      "    coords = symbols('x y z',real=True)\n",
      "    (o3d,e1,e2,e3) = Ga.build('e',g=[1,1,1],coords=coords)\n",
      "    v = o3d.mv('v', 'vector')\n",
      "    print(v)\n",
      "\n",
      "    print(v.grade(2))\n",
      "    print(v.i_grade)\n",
      "\n",
      "    return\n",
      "\n",
      "Code output:\n",
      "\n",
      "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\n",
      "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\n",
      "v__x\u001b[0m*\u001b[0;34me_x\u001b[0m + v__y\u001b[0m*\u001b[0;34me_y\u001b[0m + v__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "v__x*\u001b[0;34me_x\u001b[0m + v__y*\u001b[0;34me_y\u001b[0m + v__z*\u001b[0;34me_z\u001b[0m\n",
      "0\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "%run mv_setup_options.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A = z*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m - y*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + x*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "grad^A = 3*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "\n",
      "f = 1/sqrt(x**2 + y**2 + z**2)\n",
      "grad*f = -x*\u001b[0;34me_x\u001b[0m/(x**2 + y**2 + z**2)**(3/2) - y*\u001b[0;34me_y\u001b[0m/(x**2 + y**2 + z**2)**(3/2) - z*\u001b[0;34me_z\u001b[0m/(x**2 + y**2 + z**2)**(3/2)\n",
      "\n",
      "B = z*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m/sqrt(x**2 + y**2 + z**2) - y*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m/sqrt(x**2 + y**2 + z**2) + x*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m/sqrt(x**2 + y**2 + z**2)\n",
      "\n",
      "grad^B = 2*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m/sqrt(x**2 + y**2 + z**2)\n"
     ]
    }
   ],
   "source": [
    "%run prob_not_solenoidal.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Matrix([\n",
      "[                                                                           \u001b[0;36mD{u}\u001b[0;31mx\u001b[0m\u001b[0m**2 + \u001b[0;36mD{u}\u001b[0;31my\u001b[0m\u001b[0m**2 + \u001b[0;36mD{u}\u001b[0;31mz\u001b[0m\u001b[0m**2, \u001b[0;36mD{u}\u001b[0;31mx\u001b[0m\u001b[0m*\u001b[0;36mD{v}\u001b[0;31mx\u001b[0m\u001b[0m + \u001b[0;36mD{u}\u001b[0;31my\u001b[0m\u001b[0m*\u001b[0;36mD{v}\u001b[0;31my\u001b[0m\u001b[0m + \u001b[0;36mD{u}\u001b[0;31mz\u001b[0m\u001b[0m*\u001b[0;36mD{v}\u001b[0;31mz\u001b[0m\u001b[0m],\n",
      "[\u001b[0;36mD{u}\u001b[0;31mx\u001b[0m\u001b[0m*\u001b[0;36mD{v}\u001b[0;31mx\u001b[0m\u001b[0m + \u001b[0;36mD{u}\u001b[0;31my\u001b[0m\u001b[0m*\u001b[0;36mD{v}\u001b[0;31my\u001b[0m\u001b[0m + \u001b[0;36mD{u}\u001b[0;31mz\u001b[0m\u001b[0m*\u001b[0;36mD{v}\u001b[0;31mz\u001b[0m\u001b[0m,                                                                            \u001b[0;36mD{v}\u001b[0;31mx\u001b[0m\u001b[0m**2 + \u001b[0;36mD{v}\u001b[0;31my\u001b[0m\u001b[0m**2 + \u001b[0;36mD{v}\u001b[0;31mz\u001b[0m\u001b[0m**2]])\n",
      "1\n",
      "0\n",
      "0\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "%run reciprocal.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a = a__x\u001b[0m*\u001b[0;34me_x\u001b[0m + a__y\u001b[0m*\u001b[0;34me_y\u001b[0m + a__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "b = b__x\u001b[0m*\u001b[0;34me_x\u001b[0m + b__y\u001b[0m*\u001b[0;34me_y\u001b[0m + b__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "c = c__x\u001b[0m*\u001b[0;34me_x\u001b[0m + c__y\u001b[0m*\u001b[0;34me_y\u001b[0m + c__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n",
      "ab = (a__x\u001b[0m - b__x\u001b[0m)*\u001b[0;34me_x\u001b[0m + (a__y\u001b[0m - b__y\u001b[0m)*\u001b[0;34me_y\u001b[0m + (a__z\u001b[0m - b__z\u001b[0m)*\u001b[0;34me_z\u001b[0m\n",
      "ab/|ab| = (a__x\u001b[0m - b__x\u001b[0m)*\u001b[0;34me_x\u001b[0m/ab_mag + (a__y\u001b[0m - b__y\u001b[0m)*\u001b[0;34me_y\u001b[0m/ab_mag + (a__z\u001b[0m - b__z\u001b[0m)*\u001b[0;34me_z\u001b[0m/ab_mag\n",
      "R_ab = cos(theta_ab/2) + (a__z\u001b[0m - b__z\u001b[0m)*cos(theta_ab/2)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m/ab_mag + (-a__y\u001b[0m + b__y\u001b[0m)*cos(theta_ab/2)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m/ab_mag + (a__x\u001b[0m - b__x\u001b[0m)*cos(theta_ab/2)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m/ab_mag\n",
      "R_ab_rev = cos(theta_ab/2) + (-a__z\u001b[0m + b__z\u001b[0m)*cos(theta_ab/2)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m/ab_mag + (a__y\u001b[0m - b__y\u001b[0m)*cos(theta_ab/2)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m/ab_mag + (-a__x\u001b[0m + b__x\u001b[0m)*cos(theta_ab/2)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m/ab_mag\n",
      "e_ab_x = (a__x\u001b[0m**2 - 2*a__x\u001b[0m*b__x\u001b[0m - a__y\u001b[0m**2 + 2*a__y\u001b[0m*b__y\u001b[0m - a__z\u001b[0m**2 + 2*a__z\u001b[0m*b__z\u001b[0m + ab_mag**2 + b__x\u001b[0m**2 - b__y\u001b[0m**2 - b__z\u001b[0m**2)*cos(theta_ab/2)**2*\u001b[0;34me_x\u001b[0m/ab_mag**2 + 2*(a__x\u001b[0m*a__y\u001b[0m - a__x\u001b[0m*b__y\u001b[0m - a__y\u001b[0m*b__x\u001b[0m + ab_mag*(-a__z\u001b[0m + b__z\u001b[0m) + b__x\u001b[0m*b__y\u001b[0m)*cos(theta_ab/2)**2*\u001b[0;34me_y\u001b[0m/ab_mag**2 + 2*(a__x\u001b[0m*a__z\u001b[0m - a__x\u001b[0m*b__z\u001b[0m - a__z\u001b[0m*b__x\u001b[0m + ab_mag*(a__y\u001b[0m - b__y\u001b[0m) + b__x\u001b[0m*b__z\u001b[0m)*cos(theta_ab/2)**2*\u001b[0;34me_z\u001b[0m/ab_mag**2\n",
      "e_ab_y = 2*(a__x\u001b[0m*a__y\u001b[0m - a__x\u001b[0m*b__y\u001b[0m - a__y\u001b[0m*b__x\u001b[0m + ab_mag*(a__z\u001b[0m - b__z\u001b[0m) + b__x\u001b[0m*b__y\u001b[0m)*cos(theta_ab/2)**2*\u001b[0;34me_x\u001b[0m/ab_mag**2 + (-a__x\u001b[0m**2 + 2*a__x\u001b[0m*b__x\u001b[0m + a__y\u001b[0m**2 - 2*a__y\u001b[0m*b__y\u001b[0m - a__z\u001b[0m**2 + 2*a__z\u001b[0m*b__z\u001b[0m + ab_mag**2 - b__x\u001b[0m**2 + b__y\u001b[0m**2 - b__z\u001b[0m**2)*cos(theta_ab/2)**2*\u001b[0;34me_y\u001b[0m/ab_mag**2 + 2*(a__y\u001b[0m*a__z\u001b[0m - a__y\u001b[0m*b__z\u001b[0m - a__z\u001b[0m*b__y\u001b[0m + ab_mag*(-a__x\u001b[0m + b__x\u001b[0m) + b__y\u001b[0m*b__z\u001b[0m)*cos(theta_ab/2)**2*\u001b[0;34me_z\u001b[0m/ab_mag**2\n",
      "e_ab_z = 2*(a__x\u001b[0m*a__z\u001b[0m - a__x\u001b[0m*b__z\u001b[0m - a__z\u001b[0m*b__x\u001b[0m + ab_mag*(-a__y\u001b[0m + b__y\u001b[0m) + b__x\u001b[0m*b__z\u001b[0m)*cos(theta_ab/2)**2*\u001b[0;34me_x\u001b[0m/ab_mag**2 + 2*(a__y\u001b[0m*a__z\u001b[0m - a__y\u001b[0m*b__z\u001b[0m - a__z\u001b[0m*b__y\u001b[0m + ab_mag*(a__x\u001b[0m - b__x\u001b[0m) + b__y\u001b[0m*b__z\u001b[0m)*cos(theta_ab/2)**2*\u001b[0;34me_y\u001b[0m/ab_mag**2 + (-a__x\u001b[0m**2 + 2*a__x\u001b[0m*b__x\u001b[0m - a__y\u001b[0m**2 + 2*a__y\u001b[0m*b__y\u001b[0m + a__z\u001b[0m**2 - 2*a__z\u001b[0m*b__z\u001b[0m + ab_mag**2 - b__x\u001b[0m**2 - b__y\u001b[0m**2 + b__z\u001b[0m**2)*cos(theta_ab/2)**2*\u001b[0;34me_z\u001b[0m/ab_mag**2\n",
      "cos(phi/2) - sin(phi/2)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m\n",
      "cos(phi/2) + sin(phi/2)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_y\u001b[0m\n",
      "-sin(phi)*\u001b[0;34me_x\u001b[0m + cos(phi)*\u001b[0;34me_y\u001b[0m\n",
      "cos(theta/2) - sin(theta/2)*cos(phi)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m - sin(phi)*sin(theta/2)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "cos(theta/2) + sin(theta/2)*cos(phi)*\u001b[0;34me_x\u001b[0m^\u001b[0;34me_z\u001b[0m + sin(phi)*sin(theta/2)*\u001b[0;34me_y\u001b[0m^\u001b[0;34me_z\u001b[0m\n",
      "e_r = cos(phi)*cos(theta)*\u001b[0;34me_x\u001b[0m + sin(phi)*cos(theta)*\u001b[0;34me_y\u001b[0m + sin(theta)*\u001b[0;34me_z\u001b[0m\n",
      "e_th = -sin(theta)*cos(phi)*\u001b[0;34me_x\u001b[0m - sin(phi)*sin(theta)*\u001b[0;34me_y\u001b[0m + cos(theta)*\u001b[0;34me_z\u001b[0m\n",
      "e_phi = -sin(phi)*\u001b[0;34me_x\u001b[0m + cos(phi)*\u001b[0;34me_y\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "%run rotations.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
